package com.yum.web.controller;

import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Package: com.yum.web.controller
 * Description： TODO
 * Author: Forest
 * Date: Created in 2021/3/27 21:17
 * Version: 0.0.1
 * Modified By: duforest
 */
@Api(tags = "测试接口")
@RestController
@RequestMapping("test")
public class TestController {

    /**
     * 测试用例
     *
     * @param name
     * @param age
     * @return
     */
    @ApiOperation(value = "测试", notes = "测试用例")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "用户", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "age", value = "年龄", dataType = "Integer", paramType = "query")})
    @RequestMapping(value = "hello", method = RequestMethod.GET)
    public String add(String name, String age) {
        return name + "，您好！" + age;
    }


    /**
     * 添加用户
     *
     * @param user
     * @return
     */
    @ApiOperation(value = "添加", notes = "添加用户")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "user", value = "用户", dataType = "String", paramType = "query")})
    @ApiResponse(code = 200, message = "success")
    @GetMapping("add")
    public String add(String user) {
        return "ok," + user;
    }


}
